package com.mingnew.ecache.config;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;

/**
 * @author : lk
 * @date 2021/5/2 12:50
 **/
@Configuration
public class CacheConfig {
    @Bean(value = {"myKeyGenerator"})
    public KeyGenerator keyGenerator(){
        return (target, method, params) -> method.getName()+"["+ Arrays.asList(params).toString()+"]";
    }
}
